package string;

import java.util.Scanner;

public class SubstringDemo {
    public static void main(String[] args) {
        String str="123.456.789";
        Scanner scanner=new Scanner(System.in);
        int start=str.indexOf(".")+1;
        int end=str.lastIndexOf(".",start);
        str=str.substring(start,end);
        System.out.println(str);
    }
}
